using Microsoft.VisualStudio.Modeling.Shell;
using Microsoft.VisualStudio.Modeling;

namespace Dslfactory.wcfLanguage
{
 internal partial class wcfLanguageExplorer
 {
  /// <summary>
  /// Change the icons for the collections
  /// </summary>
  public override RoleGroupTreeNode CreateRoleGroupTreeNode(DomainRoleInfo targetRoleInfo)
  {
   RoleGroupTreeNode treeNode = base.CreateRoleGroupTreeNode(targetRoleInfo);

   if (targetRoleInfo.Id == ServicesDefinitionHasDataContracts.DataContractDomainRoleId)
    treeNode.SelectedImageIndex = treeNode.ImageIndex = 3;

   else if (targetRoleInfo.Id == ServicesDefinitionHasMessageContracts.MessageContractDomainRoleId)
    treeNode.SelectedImageIndex = treeNode.ImageIndex = 3;

   else if (targetRoleInfo.Id == ServicesDefinitionHasInterfaces.InterfaceDomainRoleId)
    treeNode.SelectedImageIndex = treeNode.ImageIndex = 6;

   else if (targetRoleInfo.Id == ServicesDefinitionHasServices.ServiceDomainRoleId)
    treeNode.SelectedImageIndex = treeNode.ImageIndex = 8;

   else if (targetRoleInfo.Id == ServicesDefinitionHasHosting.HostingDomainRoleId)
    treeNode.SelectedImageIndex = treeNode.ImageIndex = 5;

   return treeNode;
  }
 }
}
